package com.dmy.chat.server.netty.command;

import com.dmy.chat.server.netty.UserChannelBind;
import com.dmy.chat.server.netty.message.Messages;
import io.netty.channel.Channel;

/**
 * create by YCQ for 2020/1/15 11:29
 */
public class UserLoginCommand extends AbstractUserEventCommand {

    public UserLoginCommand(UserChannelBind channelBind, Channel channel, Messages messages) {
        super(channelBind, channel, messages);
    }

    @Override
    public void exec0() {
        String userId = messages.getExtAttribute("userId");
        channelBind.register(userId,channel);
        channel.writeAndFlush("登陆成功");
    }
}
